Hygienic Source-Code Generation Using Functors
نویسنده
چکیده
Existing source-code-generating tools such as Lex and Yacc suffer from practical inconveniences because they use disembodied code to implement actions. To prevent this problem, such tools could generate closed functors that are then instantiated by the programmer with appropriate action code. This results in all code being type checked in its appropriate context, and it assists the type checker in localizing errors correctly. We have implemented a lexer generator and parser generator based on this technique for both Standard ML and Haskell.
منابع مشابه
Hygienic Quasiquotation in Scheme Distilled Tutorial
Quasiquotation in Scheme is nearly ideal for implementing programs that generate other programs. These programs lack only the ability to generate fresh bound identifiers, as required to make such code-manipulating programs hygienic, but any Scheme programmer knows how to provide this ability using gensym. In this tutorial we investigate hygienic quasiquotation in Scheme and in languages influen...
متن کاملScoping Constructs for Program Generators
Program generation is the process of generating code in a high-level language (e.g., C, C++, Java) to implement an abstract specification of a program. Generated programs are created by synthesizing and composing code fragments. Binding identifiers in generated code with their correct variable declarations has been the focus of a lot of research work in the context of macro-expansion (e.g., hyg...
متن کاملUltrasonic guided waves reflection from simple dent in pipe for defect rate estimation and parameters determination of axisymmetric wave generation source
In this paper, the reflection of ultrasonic guided waves from simple dent in pipes has been investigated using finite element method and the relationship between reflection coefficient of these waves and deformation rate has been determined. Also, the effect of the parameters of wave generation source on the generated wave field has been investigated using normal modes expansion method. At firs...
متن کاملHygienic Literate Programming: Lessons from ChezWEB
Literate programming systems are a class of domain specific languages designed to encourage writing programs specifically to be read as essays or books by humans instead of by machines. Systems like CWEB, WEB, and ChezWEB allow the user to associate arbitrary code bodies with a concise but natural language description. That description may then be referred to in other sections of the program so...
متن کاملFirst-Class Modules for Perl
ML’s functors allow developers to write code which generates software modules at compile time. We present a system for a similar, but more powerful, feature for the popular industrygrade language Perl, which is frequently used for implementing Internet services and “glue” software. This enables the modular development of parameterized packages and classes, as well as several other features ofte...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/1801.01579 شماره
صفحات -
تاریخ انتشار 2017